
"""
取消订单
"""
import os
import sys
import django

base_url = os.path.split(os.path.split(os.getcwd())[0])[0]
print(base_url)
sys.path.insert(0, os.path.split(os.path.split(os.getcwd())[0])[0])
os.environ['DJANGO_SETTINGS_MODULE'] = 'finance_c2c.settings'
django.setup()

from apps.supply_order.models import Goods, GoodsImage

if __name__ == '__main__':
    for i in range(1385, 1395):
        print(i)
        goods_obj = Goods.objects.get(id=i)
        goods_images_queryset = goods_obj.goods_images.all()
        for goods_images in goods_images_queryset:
            # print(goods_images.path)
            path = goods_images.path.replace("/haihulu/","/yishouxian/")
            print(path)
            goods_images.path = path
            goods_images.save()